# -*- coding: utf-8 -*-
#----------------------------------------------
# @note: example link for test chain
# @author: Andrey Simine
# @copyright: (R) 2016 Andrey Simine
#----------------------------------------------
import time, sys

from pprint import pprint
from chainlib.basic_link import BasicLink

__author__ = 'asimine'

class UserLink(BasicLink):

    def __init__(self, context):
        super(UserLink, self).__init__(context)

    def execute(self):
        print("Get Version of the Build")
        print("Current context ...") 
        curr_context = self.get_context()
        curr_linkdata = self.get_linkdata()
        pprint(curr_context)

        print("Set new context...")
        newvalue = {"var2": {'a':3, 'd':5},
                    "dynamic3": {"test3": 'value3'}
                   }
        pprint(newvalue)
        self.update_context(newvalue)
        
        print("------------------------------------------") 
        pprint(self.get_context())
        print("------------------------------------------") 
        print("Link data:")
        pprint(curr_linkdata) 
                
        print("Done.")

